{% extends "base/base.html" %}
{% load oracle_filter %}
{% load bootstrap3 %}
{% load static %}

{% block title %}Oracle数据库概览{% endblock %}

{% block content %}

    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-lg-12" id="split-right">

                <div class="ibox float-e-margins">

                    <div class="ibox-title">
                        <h5>Oracle数据库概览</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                            {% csrf_token %}
                            <div class="row">
                                <div class="col-sm-2">
                                    <input class="form-control input-sm" type="text" name="hostname__icontains"
                                           id="hostname"
                                           placeholder="主机名" style=""/>
                                </div>

                                <div class="col-sm-2">
                                    <select class="input-sm form-control select2   inline" name="type" id="type">
                                        <option value="">Oracle版本</option>
                                        {% for i in  ''|oracle_version_choices %}
                                            <option value="{{ i.0 }}">{{ i.1 }}</option>
                                        {% endfor %}
                                    </select>
                                </div>

                                <div class="col-sm-2">
                                    <button type="submit" class="btn btn-sm btn-primary"> 搜索</button>
                                </div>
                            </div>
                        <br/>

                        <div class="table-responsive">
                            <form class="form-horizontal  "
                                  method="post">
                                {% csrf_token %}
                                <table class="table table-striped table-bordered table-hover dataTables-code">
                                    <thead>
                                    <tr>
                                      <th>ID</th>
                                      <th>标签</th>
                                      <th>IP地址</th>
                                      <th>端口号</th>
                                      <th>服务名</th>
                                      <th>服务名(CDB)</th>
                                      <th>监控用户</th>
                                      <th>监控用户(CDB)</th>
                                      <th>os用户</th>
                                      <th>SSH端口</th>
                                      <th>版本</th>
                                      <th>通断告警</th>
                                      <th>tbs告警</th>
                                      <th>adg告警</th>
                                      <th>temp告警</th>
                                      <th>undo告警</th>
                                      <th>连接数告警</th>
                                      <th>后台日志告警</th>
                                      <th>失效索引告警</th>
                                      <th>锁异常告警</th>
                                      <th>密码过期告警</th>
                                      <th>综合性能告警</th>
                                      <th>pga使用率告警</th>
                                      <th>归档使用率告警</th>
                                      <th>编辑</th>
                                      <th>删除</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {% for row in oraclelist %}
                                        <tr class="gradeA" id="{{ row.id }}" name="{{ row.hostname }}">
                                          <td>{{ forloop.counter }} </td>
                                          <td>{{ row.tags}} </td>
                                          <td>{{ row.host}} </td>
                                          <td>{{ row.port}} </td>
                                          <td>{{ row.service_name}} </td>
                                          <td>{{ row.service_name_cdb}} </td>
                                          <td>{{ row.user}} </td>
                                          <td>{{ row.user_cdb}} </td>
                                          <td>{{ row.user_os}} </td>
                                          <td>{{ row.ssh_port_os}} </td>
                                          <td>{{ row.version}} </td>
                                        </tr>
                                    {% endfor %}
                                    </tbody>
                                </table>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}